package com.mccrea.pattern.singleton.type7;

/**
 * @Classname SingleTonTest07
 * @Description 单例模式，枚举
 * @Date 2021/5/7 0007 16:30
 * @Created by Mccrea_Gao
 */
public class SingleTonTest07 {
    public static void main(String[] args) {
        SingleTon07 instance = SingleTon07.INSTANCE;
        SingleTon07 instance1 = SingleTon07.INSTANCE;
        System.out.println(instance.hashCode());
        System.out.println(instance1.hashCode());
    }
}

enum SingleTon07 {
    INSTANCE;

    public void method() {
        System.out.println("调用方法");
    }
}
